const name = 'tom'
let age = 18
let gender = '男'

//计算机功能，没有判断参数合法性
function calculate(firstNum,lastNum,option){
    switch (option){
        case '+':
            return firstNum + lastNum
        case '-':
            return firstNum - lastNum
        case '*':
           return firstNum * lastNum
        case '/':
            return firstNum / lastNum
    }
}

let person = {name,age,gender}

//封装请求方法
function request (url,params){
    let method = params.method
    if(method==='GET'){
        return axios.get(url,{params})
    }else{
        return axios.post(url,{
            username:params.username,
            password:params.password
        })
    }
}

export{name,age,gender,calculate,person,request}